package com.zh.baselibrary.api;

import com.zh.baselibrary.netutils.BaseResp;
import com.zh.model.Errata;
import com.zh.model.request.ErrorInfo;
import com.zh.model.task.error.ErrorDetailBean;
import com.zh.model.task.error.ErrorDetailVOBean;
import com.zh.model.task.home.ClassCabinetBean;
import com.zh.model.task.home.CommitBean;
import com.zh.model.task.home.CommitResBean;
import com.zh.model.task.home.RemoteOpenResVO;
import com.zh.model.task.home.ReportVersionBean;
import com.zh.model.task.home.ValidateBean;
import com.zh.model.task.home.ValidateResBean;
import com.zh.model.task.relation.AssociateTag;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @author EnzoChan
 * @create 2019/4/8
 * @desc:
 */
public interface ITaskBusiness {

    /**
     * 获取柜子详情
     *
     * @param schoolId
     * @param equipmentCode
     * @return
     */
    @GET("/jdb/equipment/{schoolId}/detail")
    Observable<BaseResp<ClassCabinetBean>> detail(@Path("schoolId") String schoolId,
                                            @Query("equipmentCode") String equipmentCode);


    /**
     * 提交作业
     *
     * @param schoolId
     * @param info
     * @return
     */
    @POST("/jdb/homework/{schoolId}/commit")
    Observable<BaseResp<CommitResBean>> commit(@Path("schoolId") String schoolId, @Body CommitBean info);

    /**
     * 课代表取出作业
     *
     * @param schoolId
     * @param info
     * @return
     */
    @POST("/jdb/homework/{schoolId}/complete")
    Observable<BaseResp<Object>> complete(@Path("schoolId") String schoolId, @Body CommitBean info);

    /**
     * 校验射频标签
     *
     * @param radioCode
     * @return
     */
    @POST("/jdb/homework/validate")
    Observable<BaseResp<ValidateBean>> validate(@Body ValidateResBean radioCode);

    /**
     * 关联作业本
     *
     * @param schoolId   学生ID
     * @param radioCodes 射频标签集合
     * @return
     */
    @POST("/jdb/homework/{schoolId}/associate")
    Observable<BaseResp<Object>> associate(@Path("schoolId") String schoolId, @Body List<String> radioCodes);

    /**
     * 关联作业本
     *
     * @param schoolId   学生ID
     * @param associateTagVO 射频标签集合
     * @return
     */
    @POST("/jdb/homework/{schoolId}/associateCurrencyTag")
    Observable<BaseResp<Object>> associateCurrencyTag(@Path("schoolId") String schoolId, @Body List<AssociateTag> associateTagVO);

    /**
     * 上报设备版本号
     *
     * @param equipmentCode
     * @param versionBean
     * @return
     */
    @POST("/jdb/equipment/{equipmentCode}/reportversion")
    Observable<BaseResp<Object>> reportVersion(@Path("equipmentCode") String equipmentCode, @Body ReportVersionBean versionBean);

    /**
     * 获取该柜子（科目）误投明细 V1.2.2
     *
     * @param versionBean
     * @return
     */
    @POST("/jdb/homework/miscarriages/detail")
    Observable<BaseResp<ErrorDetailBean>> detail(@Body ErrorDetailVOBean versionBean);

    /**
     * 勘误完成
     *
     * @param versionBean
     * @return
     */
    @POST("/jdb/homework/errata/complte")
    Observable<BaseResp<Object>> complte(@Body ErrorDetailVOBean versionBean);

    /**
     * 远程开箱结果
     *
     * @param remoteOpenResVO
     * @return
     */
    @POST("/jdb/equipment/remoteopen/result")
    Observable<BaseResp<Object>> remoteOpenResult(@Body RemoteOpenResVO remoteOpenResVO);

    /**
     * 开柜成功
     *
     * @return
     */
    @POST("/jdb/equipment/opensuccess")
    Observable<BaseResp<Object>> openSuccess(@Body Errata errata);


}
